function withLogging(value, context) {
  console.log(value, 'value')
  console.log(context, 'context')

  context.addInitializer(function () {
    console.log('类或属性定义时执行的额外逻辑', this)
  })
}

class MyClass {
  constructor() {
    console.log('constructor')
  }
}

withLogging(MyClass, {
  name: 'MyClass', 
  kind: 'class', 
  addInitializer: function(fn) {
    fn.call(MyClass) // 回调函数的 this 指向类本身
  }
})